home *** CD-ROM | disk | FTP | other *** search
/ Aminet 22 / Aminet 22 (1997)(GTI - Schatztruhe)[!][Dec 1997].iso / Aminet / biz / dopus / MPEGA_GUIplay.lha / MPEGA-Play.dopus5 < prev   
Text File  |  1997-09-27  |  4KB  |  170 lines

  1. /* $VER: MPEGA-Play.dopus5 1.6 (26 Sep 1997)
  2.    ©1997 by mike@kily.ruhr.de (http://kily.home.pages.de)
  3.  
  4.  DOPUS5.5+ AREXX Script for MPEG-Soundplaying
  5.  with ProgressBarGui via MPEGA SoundPlayer
  6.  
  7.  needs:
  8.   DOPUS 5.5+
  9.   MPEGA 3.3
  10.   TBreak > Aminet:util/cli/TBreak.lha for play abort function.
  11.  
  12.  description:
  13.   A DOPUS GUI for the Great MPEGA player by Stephane TAVENARD.
  14.   displays Name/MPEG-Quality/Time in a DOPUS PROGRESS Window.
  15.   it shows the runtime on a proggressbar and a timecounter.
  16.  
  17.  installation:
  18.   as Button,Menu,...
  19.   NO Parameters, only select: <AREXX> Dopus5:ARexx/MPEGA-Play.dopus5
  20.  
  21.   If you want to use this script from multiply OPUS add the DOPUS Port:
  22.   <AREXX> Dopus5:ARexx/MPEGA-Play.dopus5 {Qp}
  23.  
  24.   For Filetype-startup (dobbleclick start) install it as:
  25.   <AREXX> Dopus5:ARexx/MPEGA-Play.dopus5 {Qp} {Ql} {o}
  26.  
  27.  usage:
  28.   select all .mp files and start MPEG-play.
  29.   if you want to skip a sound a file press the abort button.
  30.   to abort the complete script abort two soundplayings in the first 5 secs.
  31.  
  32.  configuration:
  33.   check/change the mpega startup parameters in this script.
  34.   to change the abort time change "stop<5 & secs<5" in this script.
  35.  
  36.  bugs:
  37.   if MPEGA needs too much CPU-Power then the time display is too slow/wrong.
  38.   solution: get a faster CPU.
  39.  
  40.  EmailWare:
  41.   this script ist Email-ware,
  42.   please mail me your favourit MP3 Internet-Site !
  43.  
  44. */
  45.  
  46. PARSE ARG portname handle file .
  47.  
  48. IF portname='' THEN portname='DOPUS.1'
  49. ADDRESS VALUE portname
  50.  
  51. OPTIONS RESULTS
  52.  
  53. IF handle="" THEN DO
  54.  
  55.  LISTER QUERY SOURCE
  56.  handle=result
  57.  IF RC~=0 THEN DO
  58.   DOPUS REQUEST '"no Source-directory selected !?!" OOPS!'
  59.   EXIT
  60.  END
  61.  
  62.  LISTER QUERY Handle selfiles stem files.
  63.  IF files.count=0 THEN DO
  64.   DOPUS REQUEST '"no MPEG sound-files selected !?!" OOPS!'
  65.   EXIT
  66.  END
  67.  
  68. END
  69.  
  70. IF file~="" then DO
  71.  files.0=compress(file,'"')
  72.  files.count=1
  73. END
  74.  
  75.  
  76. LISTER QUERY Handle path
  77. pfad=result
  78.  
  79. LISTER SET Handle BUSY ON
  80. LISTER SET Handle newprogress name info bar abort
  81.  
  82. DO j = 0 TO files.count-1
  83. IF index(upper(files.j),".MP") >1 then do
  84.  
  85.  LISTER SET Handle NEWPROGRESS NAME "MPEGA-dopus5-GUI by mike@kily.ruhr.de"
  86.  LISTER SET Handle NEWPROGRESS INFO "Time: 00:00 / 00:00 / Name: "files.j
  87.  LISTER SET Handle NEWPROGRESS bar 10 0
  88.  
  89.  file='"'pfad||files.j'"'
  90.  ADDRESS COMMAND 'RUN >NIL: mpega <nil: -d2 -q2 -v120 -T 'file' >PIPE:mpegout'
  91.  
  92.  CALL Open('mpegout','PIPE:mpegout','r')
  93.  
  94.  string = ReadLn('mpegout')
  95.  string=Text( string )
  96.  
  97.  parse var string version "[680"CPU "(C)"dummy
  98.  version=version" "CPU
  99.  
  100.  LISTER SET Handle NEWPROGRESS title j+1' / 'files.count' - 'version
  101.  
  102.  DO until dummy=""
  103.   dummy = ReadLn('mpegout')
  104.  END
  105.  
  106.  string = ReadLn('mpegout')
  107.  string=Text( string )
  108.  
  109.  parse var string dummy"MPEG"MTYPE
  110.  string="MPEG"MTYPE
  111.  
  112.  LISTER SET Handle NEWPROGRESS NAME string
  113.  
  114.  string = ReadLn('mpegout')
  115.  string=Text( string )
  116.  parse var string dummy": "pm":"ps
  117.  
  118.  ptotal=pm*60+ps
  119.  secs=0
  120.  LISTER SET Handle NEWPROGRESS bar ptotal 0
  121.  
  122.  DO UNTIL Eof('mpegout')
  123.  
  124.   time=ReadCh('mpegout',29)
  125.  
  126.   time=left(right(time,10),5)
  127.   secs=secs+1
  128.   if time="" then time=" End."
  129.   LISTER QUERY Handle abort
  130.   IF RESULT THEN DO
  131.    ADDRESS COMMAND 'TBREAK MPEGA >nil:'
  132.    if stop<5 & secs<5 then do
  133.     LISTER REFRESH Handle
  134.     LISTER SET Handle BUSY OFF
  135.     CALL Close('mpegout')
  136.     EXIT
  137.    end
  138.    stop=secs
  139.   END
  140.   ELSE DO
  141.    LISTER SET Handle NEWPROGRESS INFO 'Time: 'pm":"ps" / "time" / Name: "files.j
  142.    LISTER SET Handle NEWPROGRESS bar ptotal secs
  143.   END
  144.  
  145.  END
  146.  LISTER CLEAR Handle abort
  147.  CALL Close('mpegout')
  148.  LISTER SELECT Handle files.j OFF
  149.  LISTER REFRESH Handle
  150. END
  151. END
  152.  
  153. LISTER SET Handle BUSY OFF
  154.  
  155. EXIT
  156.  
  157.  
  158. TEXT:
  159. PROCEDURE
  160.  TEXT=Arg( 1 )
  161.  esc2=1
  162.  do until esc1=0
  163.   esc1=Verify(text,'1b'x,'m')
  164.   if esc1~=0 then text=delstr(text,esc1,1)
  165.   parse var text d1'[1m'd2'[22m'd3
  166.   text=d1||d2||d3
  167.  end
  168.  
  169. RETURN TEXT
  170.